/**
 * 
 */
package com.geekteam.masterenglish.Adapter;

import java.util.List;

import com.geekteam.masterenglish.ui.fragment.DetailLessionFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

/**
 * @author MTROL
 *
 */
public class DetailFragmentAdapter extends FragmentPagerAdapter{

	private List<String> mLessionIds;
	
	public DetailFragmentAdapter(FragmentManager fm, List<String> ids) {
		super(fm);
		mLessionIds = ids;
	}

	@Override
	public Fragment getItem(int position) {
		if(mLessionIds==null){
			return null;
		}
		
		String lessionId = mLessionIds.get(position);
		DetailLessionFragment fragment = new DetailLessionFragment(lessionId);
		return fragment;
	}

	@Override
	public int getCount() {
		return mLessionIds == null?0:mLessionIds.size();
	}

}
